home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / dev / www_talk.930 / 000607_timbl@www3.cern.ch _Thu Jan 28 08:00:51 1993.msg < prev    next >
Internet Message Format  |  1994-01-24  |  4KB

  1. Return-Path: <timbl@www3.cern.ch>
  2. Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
  3.     id AA25591; Thu, 28 Jan 93 08:00:51 MET
  4. Received: from www3.cern.ch by dxmint.cern.ch (5.65/DEC-Ultrix/4.3)
  5.     id AA10947; Thu, 28 Jan 1993 08:16:31 +0100
  6. Received: by www3.cern.ch (NX5.67c/NX3.0S)
  7.     id AA03115; Thu, 28 Jan 93 08:14:39 +0100
  8. Date: Thu, 28 Jan 93 08:14:39 +0100
  9. From: Tim Berners-Lee <timbl@www3.cern.ch>
  10. Message-Id: <9301280714.AA03115@www3.cern.ch>
  11. Received: by NeXT.Mailer (1.87.1)
  12. Received: by NeXT Mailer (1.87.1)
  13. To: pflynn@curia.ucc.ie (Peter Flynn)
  14. Subject: Re: Getting searching to work
  15. Cc: www-talk@nxoc01.cern.ch
  16. Reply-To: timbl@nxoc01.cern.ch
  17.  
  18.  
  19. >  Date: Wed, 27 Jan 93 16:33:38 GMT
  20. >  From: pflynn@curia.ucc.ie (Peter Flynn)
  21. >  
  22.  
  23. >  How is it best to add a simple search facility to a httpd server?
  24. >  Or, better put, if a user wends hir way into one of my html menus,
  25. >  is there a simple addition I can make that will add a search  
  26. capability?
  27.  
  28. Not as simple as you'd like, I suspect.  The httpd daemon doesn't  
  29. support a search directly.  What you can do is (hack httpd or) run  
  30. another daemon which is completely written in sh or csh or perl (pick  
  31. your favorite).  There are some examples on the web. Then you have
  32. something like
  33.  
  34.   <dt><a name=something
  35.  href="http://curia.ucc.ie:9000/keywordsearchsearch/joyce">
  36.  Search<dd>the above texts for a name or keyword
  37.  
  38. When the user follows the link, the special server  on
  39. port 9000 gets a
  40.     GET /keywordsearchsearch/joyce
  41. request, and returns a search panel document:
  42.  
  43.   <head>
  44.     <isindex>
  45.   </head>
  46.   <body>
  47.   Give keywords, or words from the title, to find books
  48.   by James Joyce which match all keywords given.
  49.   </body>
  50.  
  51. The <isindex> flag tells the www program that the document is a  
  52. search panel and enables the FIND command. (On smarter browers it
  53. enables the search text input field.)
  54.  
  55. When the user types a keyword, that same special server gets a
  56. different request:
  57.  
  58.     GET /keywordsearch/joyce?portrait+young
  59.  
  60. Your script reads that from stdin and must write the result back to
  61. stdout. Like
  62.  
  63.     #! /bin/csh
  64.     request = ( `echo "$<" ) 
  65.  
  66.     'echo request[2] | sed -f request.sed ' | sed -f reply.sed
  67.     
  68. where request.sed is something like 
  69.  
  70.     s|^\([^/]*\)/\([^?]*\)?\(.*\)| pat -\1 -cat \2 \3|g
  71.     s|+| |g
  72.  
  73. (I no nothing of pat, so that is all made up. Notice I used parts of  
  74. the address of the serach panel to specify options to pat)  The  
  75. output is formatted into a hypertext file, in the example by  
  76. reply.sed
  77. which has to generate a hypertext document with a valid reference
  78. to the found documents with their addresses on your original
  79. httpd server.
  80.  
  81. Which all is in fact simpler than it looks -- largely because the
  82. thibng is just a program runnng from stdin to stdout which you
  83. can test on a terminal.  When you run it under inetd (just like
  84. httpd is run, but on port 9000) it is inetd which takes care of
  85. attaching stdin and stdout to the client.
  86.  
  87. As pat sounds like a serious peice of retrieval machinery, it
  88. would certainly be worth wrapping it up as a W3 server to make it
  89. available on the web.
  90.  
  91. A couple of hints:  1. Put lots of parameters into the address
  92. of the serach panels so that you can put pointers to all kinds
  93. of different pat features if you needs them
  94. 2. In the search panel document which your port 9000 server script
  95. generates, put a pointer to related serach panels, help pages etc.
  96.  
  97. >  What I'd like is something like:
  98. >  
  99.  
  100. >  <dl>
  101. >  <dt><a name=dub href="dubliners.html">Dubliners<dd>by James Joyce
  102. >  <dt><a name=ulysses href="ulysses.html">Ulysses<dd>by James Joyce
  103. >  [etc]
  104. >  <dt><a name=something href=somepointer>Search<dd>the above texts  
  105. for
  106. >  a name or keyword
  107. >  </dl>
  108.  
  109. This is basically what I have described.  When the guy follws the  
  110. link, he gets back a micro-document which tells him about the search
  111. he can do.  This is the WWW model. The Gopher model, which Dan  
  112. Connolly prefers, is that he should immediately get prompted for
  113. keywords with a default search panel. I'll discuss that in a separate  
  114. message.
  115.  
  116. Tim
  117.